home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 April: Mac OS SDK / Dev.CD Apr 98 SDK1.toast / Development Kits (Disc 1) / Apple Location Manager / Sources / Sample.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-01-09  |  3.7 KB  |  167 lines  |  [TEXT/CWIE]

  1. /*
  2.      File:        Sample.h
  3.  
  4.      Contains:    Location Manager SDK Sample Module Rez/C includes
  5.  
  6.      Version:    ALM SDK 2.0
  7.                  Package:    Location Manager SDK 2.0
  8.  
  9.      Copyright:    © 1996-1997 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        Please include the the file and version information (from above) with
  13.                  the problem description.  Developers belonging to one of the Apple
  14.                  developer programs can submit bug reports to:
  15.  
  16.                      devsupport@apple.com
  17.  
  18. */
  19.  
  20. #ifndef        __SAMPLE__
  21. #define        __SAMPLE__
  22.  
  23. // ------------------------------------------------------------------------------------------------- 
  24.  
  25. #ifdef    REZ
  26.  
  27. #include    "Types.r"
  28.  
  29. #else
  30.  
  31. #include    <Types.h>
  32.  
  33. #endif    // REZ
  34.  
  35. // ------------------------------------------------------------------------------------------------- 
  36.  
  37. // Errors...
  38.  
  39. #define        kSampleErrStrRsrcID            10000
  40. #define            kSampleImportPrefDatesIdx    1
  41. #define            kSampleCouldNotQuitIdx        2
  42. #define            kSampleBiggestKnownIdx        kSampleCouldNotQuitIdx
  43.  
  44. // Other text...
  45.  
  46. #define        kSampleMiscStrRsrcID        10001
  47. #define            kSampleDescribeTemplateIdx    1
  48.  
  49. // Constants for common use...
  50.  
  51. #define        kAppListNeverQuit            0x00
  52. #define        kAppListQuitOnSet            0x80
  53. #define        kAppListQuitOnGet            0x40
  54. #define        kAppListQuitOnGetOrSet        0xC0
  55. #define        kAppListLaunchFromEdit        0x20
  56.  
  57. #define        kNoRestart                    0x00
  58. #define        kRestartIfChanged            0x80
  59.  
  60. #define        kExecutableRsrcType            'code'
  61. #define        kExecutableRsrcID            10000
  62.  
  63. #define        kNameRsrcType                'STR '
  64. #define        kNameRsrcID                    10000
  65.  
  66. #define        kDescRsrcType                'STR '
  67. #define        kDescRsrcID                    10001
  68.  
  69. #define        kIconRsrcType                'ICON'
  70. #define        kIconRsrcID                    10000
  71.  
  72. #define        kAppsRsrcType                'apps'
  73. #define        kAppsRsrcTypeString            "apps"
  74. #define        kAppsQuitRsrcID                10000
  75. #define        kAppsEditRsrcID                10001
  76.  
  77. #define        kFilesRsrcType                'fils'
  78. #define        kFilesRsrcTypeString        "fils"
  79. #define        kFilesRsrcStartID            10000
  80.  
  81. #define        kRestartRsrcType            'rstr'
  82. #define        kRestartRsrcTypeString        "rstr"
  83. #define        kRestartRsrcStartID            10000
  84.  
  85. #define        kGetInfoRsrcID                10000
  86.  
  87. #define        kEditMessageRsrcID            10000
  88. #define            kEditOpenButton                1
  89. #define            kEditCancelButton            2
  90. #define            kEditApplyButton            3
  91.  
  92. // ------------------------------------------------------------------------------------------------- 
  93.  
  94. // A bunch of structures we keep in resources; do the rez versions first, then the C versions...
  95.  
  96. #ifdef    REZ
  97.  
  98. // Resource types for this project...
  99.  
  100. type 'TMPL' {
  101.     wide array Fields {
  102.         pstring;        // field name
  103.         string[4];        // field type
  104.     };
  105. };
  106.  
  107. type kAppsRsrcType {
  108.     integer = $$CountOf (AppArray);
  109.     array AppArray {
  110.         string[4];                // Application to quit
  111.         unsigned hex byte
  112.             neverQuit        = kAppListNeverQuit,
  113.             quitOnSet        = kAppListQuitOnSet,
  114.             quitOnGet        = kAppListQuitOnGet,
  115.             quitOnGetOrSet    = kAppListQuitOnGetOrSet,
  116.             launchFromEdit    = kAppListLaunchFromEdit;
  117.         align word;
  118.     };
  119. };
  120.  
  121. type kFilesRsrcType as 'STR ';
  122.  
  123. type kRestartRsrcType {
  124.     unsigned hex byte
  125.         dontRestart            = kNoRestart,
  126.         doRestart            = kRestartIfChanged;
  127.     align word;
  128. };
  129.  
  130. #else
  131.  
  132. #if        PRAGMA_ALIGN_SUPPORTED
  133. #pragma options align=mac68k
  134. #endif    // PRAGMA_ALIGN_SUPPORTED
  135.  
  136. // (Do not require an analog for 'TMPL')
  137.  
  138. typedef struct {
  139.     OSType                applicationCode;
  140.     UInt8                flags;
  141.     UInt8                filler1;
  142. } ApplicationEntry;
  143.  
  144. typedef struct {
  145.     SInt16                applicationCount;
  146.     ApplicationEntry    applications[kVariableLengthArray];
  147. } ApplicationListRec, *ApplicationListPtr, **ApplicationListHandle;
  148.  
  149. typedef struct {
  150.     Str255                fileName;
  151. } FileEntryRec, *FileEntryPtr, **FileEntryHandle;
  152.  
  153. typedef struct {
  154.     UInt8                flags;
  155.     UInt8                filler1;
  156. } FileFlagsRec, *FileFlagsPtr, **FileFlagsHandle;
  157.  
  158. #if        PRAGMA_ALIGN_SUPPORTED
  159. #pragma options align=reset
  160. #endif    // PRAGMA_ALIGN_SUPPORTED
  161.  
  162. #endif    // REZ
  163.  
  164. // ------------------------------------------------------------------------------------------------- 
  165.  
  166. #endif        // __SAMPLE__
  167.